function slidePage() {

	if (document.getElementById("shareSheet").style.visibility=="visible"){
			
		document.getElementById("shareSheet").style.webkitTransform="translateX(150%)";
				
			document.getElementById("shareSheet").style.MozTransform="translateX(150%)";
		
			document.getElementById("shareSheet").style.OTransform="translateX(150%)";
		
		setTimeout(function() {
		
			document.getElementById("shareSheet").style.visibility= "hidden";
				
			document.getElementById("page").style.webkitTransform="translateY(0px)";
			
				document.getElementById("page").style.MozTransform="translateY(0px)";
	
				document.getElementById("page").style.OTransform="translateY(0px)";
			
			setTimeout(function(){ slidePage(); }, 500);
				
		}, 600);
	}

	else if (document.getElementById("mainMenu").style.display=="block"){
	
		$(document).ready(function() {$("#fadeOut").fadeTo("slow", "1");});
	
		document.getElementById("mainMenu").style.zIndex="-1";
		
		document.getElementById("subMenu").style.zIndex="-1";
	
		document.getElementById("menuButton").style.webkitTransform = "rotateZ(0deg)";
		
			document.getElementById("menuButton").style.MozTransform = "rotateZ(0deg)";
		
			document.getElementById("menuButton").style.OTransform = "rotateZ(0deg)";
				
		document.getElementById("page").style.webkitTransform="translateX(0px)";
				
			document.getElementById("page").style.MozTransform="translateX(0px)";
				
			document.getElementById("page").style.OTransform="translateX(0px)";
		
		setTimeout(function() {
		
			document.getElementById("mainMenu").style.display= "none";
		
			document.getElementById("subMenu").style.display= "none";
					
			$(document).ready(function() {$(".subMenuButtons").css("display", "none");});
			
			document.getElementById("slideGrip").style.width = "40px";
								
		}, 600);
	}
	else {
	
		$(document).ready(function() {$("#fadeOut").fadeTo("slow", ".4");});
	
		document.getElementById("menuButton").style.webkitTransform = "rotateZ(-90deg)";
		
			document.getElementById("menuButton").style.MozTransform = "rotateZ(-90deg)";
		
			document.getElementById("menuButton").style.OTransform = "rotateZ(-90deg)";
				
		document.getElementById("mainMenu").style.display= "block";
		
		document.getElementById("page").style.webkitTransform="translateX(224px)";
		
			document.getElementById("page").style.MozTransform="translateX(224px)";
			
			document.getElementById("page").style.OTransform="translateX(224px)";
	
		setTimeout(function() {
		
			document.getElementById("mainMenu").style.zIndex="1";
			
			document.getElementById("slideGrip").style.width = "400px";
								
		}, 700);
	}
}



function slideSubMenu(newSubMenu) {
	
	if (document.getElementById("subMenu").style.display == "block"){
		
		document.getElementById("subMenu").style.zIndex="-1";
		
		document.getElementById("page").style.webkitTransform="translateX(224px)";
		
			document.getElementById("page").style.MozTransform="translateX(224px)";
				
			document.getElementById("page").style.OTransform="translateX(224px)";
		
		setTimeout(function() {
						
			$(document).ready(function() {$(".subMenuButtons").css("display", "none");});
			
			document.getElementById(newSubMenu).style.display = "block";
					
			setTimeout(function() {
						
				document.getElementById("page").style.webkitTransform="translateX(446px)";
					
					document.getElementById("page").style.MozTransform="translateX(446px)";
						
					document.getElementById("page").style.OTransform="translateX(446px)";
					
				setTimeout(function(){
					
					document.getElementById("subMenu").style.zIndex="1";
					
				}, 700);
			}, 100);
		}, 500); 
	}
		
	else {
		
		document.getElementById("subMenu").style.display = "block";
		
		document.getElementById(newSubMenu).style.display="block";
					
		document.getElementById("page").style.webkitTransform="translateX(446px)";
		
			document.getElementById("page").style.MozTransform="translateX(446px)";
				
			document.getElementById("page").style.OTransform="translateX(446px)";
		
		setTimeout(function() {
		
			document.getElementById("subMenu").style.zIndex="1";
		
		}, 700);
	}
}

function closeMenus() {
	
	if (document.getElementById("mainMenu").style.display=="block"){
	
		$(document).ready(function() {$("#fadeOut").fadeTo("slow", "1");});
	
		document.getElementById("mainMenu").style.zIndex="-1";
		
		document.getElementById("subMenu").style.zIndex="-1";
		
		document.getElementById("menuButton").style.webkitTransform = "rotateZ(0deg)";
		
			document.getElementById("menuButton").style.MozTransform = "rotateZ(0deg)";
		
			document.getElementById("menuButton").style.OTransform = "rotateZ(0deg)";
			
		document.getElementById("page").style.webkitTransform="translateX(0px)";
				
			document.getElementById("page").style.MozTransform="translateX(0px)";
				
			document.getElementById("page").style.OTransform="translateX(0px)";
		
		setTimeout(function() {
		
			document.getElementById("mainMenu").style.display= "none";
		
			document.getElementById("subMenu").style.display= "none";
		
			$(document).ready(function() {$(".subMenuButtons").css("display", "none");})
		;}, 500);
	}
	else if (document.getElementById("shareSheet").style.visibility=="visible"){
		
		document.getElementById("shareSheet").style.webkitTransform="translateX(150%)";
		
		setTimeout(function() {
		
			document.getElementById("shareSheet").style.visibility= "hidden";
			
			document.getElementById("page").style.webkitTransform="translateY(0px)";
				
			document.getElementById("page").style.MozTransform="translateX(0px)";
		
			document.getElementById("page").style.OTransform="translateX(0px)";
				
		}, 500);
	}
}

function slideShareSheet() {

	if (document.getElementById("shareSheet").style.visibility=="visible"){
	
		document.getElementById("shareSheet").style.webkitTransform="translateX(150%)";
		
		setTimeout(function() {
		
			document.getElementById("shareSheet").style.visibility= "hidden";
			
			document.getElementById("page").style.webkitTransform="translateY(0px)";
				
			document.getElementById("page").style.MozTransform="translateY(0px)";
		
			document.getElementById("page").style.OTransform="translateY(0px)";
				
		}, 500);
	}
	else {
		
		document.getElementById("page").style.webkitTransform="translateY(75px)";
			
			document.getElementById("page").style.MozTransform="translateY(75px)";
			
			document.getElementById("page").style.OTransform="translateY(75px)";
		
		document.getElementById("shareSheet").style.visibility= "visible";
	
		setTimeout(function() {
			
			document.getElementById("shareSheet").style.webkitTransform="translateX(0%)";
			
			document.getElementById("shareSheet").style.MozTransform="translateX(0%)";
			
			document.getElementById("shareSheet").style.OTransform="translateX(0%)";
		
		}, 100);
	}
}